export default {
    data() {
        return {
            // 默认的全局分享内容
            share: {
                title: '食品纠纷调解',
                path: '/pages/index/index',    // 全局分享的路径
                imageUrl: '/static/logo.png',    // 全局分享的图片(可本地可网络),
				// imageUrl: 'https://mp-adf91af7-51bf-4e2e-abae-1ed51120ab92.cdn.bspapp.com/cloudstorage/ca7d0601-d196-4f1c-992a-935fcce8ed79.png',
            },
        }
    },
    // 定义全局分享
    // 1.发送给朋友
    onShareAppMessage(res) {
		console.log('公用转发', res.from, res)
		if(res.from == 'button'){
			let ds = res.target.dataset
			if(ds.page && ds.page == 'cardAdd'){
				console.log('转发填报卡片信息', res.from, res)
				const salesInfo = vk.getVuex('$user.salesInfo');
				if(!salesInfo.SalesCode){
					this.$util.modal(null, '没有业务员信息，请重新登录。');
					return false;
				}
				// let path = `/pages/card/editFromSales?salesId=${salesInfo.Id}` 
				// 	+ `&Physicalexamid=${salesInfo.PhysicalexamId}` 
				// 	+ `&CjyName=${salesInfo.SalesRealName}` 
				// 	+ `&CjyCode=${salesInfo.SalesCode}` 
				// 	+ `&Dj=${salesInfo.dj}`
				// 	+ `&PhysicalexamName=${salesInfo.PhysicalexamName}`
				// 	+ `&addressdetail=${salesInfo.addressdetail}`
				// 	;
				let path = `/pages/card/editFromSales?scene=${salesInfo.Id}` ;
					// console.log('转发路径',path)
				return {
					title: salesInfo.SalesRealName + '邀请您填写证卡信息',
					path,
					imageUrl: '/static/images/logo.jpg',
				}
			}
		}
		else{
			return {
			    title: this.share.title,
			    path: this.share.path,
			    imageUrl: this.share.imageUrl  // 图片长宽比是 5:4
			}
		}
		
        
    },
    //2.分享到朋友圈
    onShareTimeline(res) {
        return {
            title: this.share.title,
            path: this.share.path,
            imageUrl: this.share.imageUrl  // 图片长宽比是 1:1
        }
    },
}